fix(plot): corner plot survives degenerate (no-dynamic-range) columns#1347
Merged
Conversation
…crash corner_cornerpy called corner.corner without a range=, so any column with zero spread (all samples equal — reduced-iteration runs like PYAUTO_TEST_MODE=1, or a parameter converged flat) raised 'no dynamic range' and killed the plot. Compute an explicit per-column range, widening degenerate columns to a small non-zero window, so the corner plot always renders. Fixes the searches/mcmc.py release smoke crash. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
autofit_workspace/scripts/searches/mcmc.pycrashes inrelease.yml'srun_smoke_testsjob (and Heart's release-fidelity workspace validation) with:Reproduced locally on current main under the release smoke profile (
PYAUTO_TEST_MODE=1 PYAUTO_SMALL_DATASETS=1 PYAUTO_FAST_PLOTS=1). The crash is here in the library, not the workspace:corner_cornerpycalledcorner.corner(...)with norange=. When any column has zero spread — all samples equal, which is expected under reduced-iteration runs and possible for any parameter that converges flat —cornerraises rather than plotting. This affects every corner-plotting search (Emcee/Zeus/Nautilus), so the fix belongs in the library.Fix
Compute an explicit per-column
range(_corner_range_from) and pass it tocorner.corner. Columns with real spread keep their(min, max); degenerate columns are widened to a small non-zero window centred on the value so the plot still renders. This is not a silent guard — the plot is produced, degenerate columns are a legitimate input.Verification
PYAUTO_TEST_MODE=1 PYAUTO_SMALL_DATASETS=1 PYAUTO_FAST_PLOTS=1 python autofit_workspace/scripts/searches/mcmc.pynow exits 0 and writescorner.png(previously crashed).test_autofit/non_linear/plot/test_samples_plotters.py(degenerate + real-spread columns).pytest test_autofit/non_linear/plot test_autofit/non_linear/samples→ 35 passed.pending-release